<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		*****构造函数设计模式(new)--->创建自己的类
		<script>
			function Fn(x, y) {
			    let sum = 10;
			    this.total = x + y;             
			    this.say = function () {
			        console.log(`我计算的和是:${this.total}`);
			    };
				
				return {name:"lili"};
			}
			//let res = Fn(10, 20); //普通函数执行
			//console.log(res);
			
			let res = new Fn(10, 20); //构造函数执行
			console.log(res);
		</script>
	</body>
</html>
